#include <iostream>
#include <cstdio>
#include <stack>

using namespace std;

char input_string[210];
/*
mat[j][j] == 1 means i_pri > j_pri
index_meaning:
    0: self_defined mark-operator(in the begin and end of the expression), whose priorith is smallest
    1: +
    2: -
    3: *
    4: /
 */
int priority_matrix[][5] = {
        1, 0, 0, 0, 0,
        1, 0, 0, 0, 0,
        1, 0, 0, 0, 0,
        1, 1, 1, 0, 0,
        1, 1, 1, 0, 0,
};
stack<int> op_stack;
stack<double> num_stack;

/*
This function for getting next value(operator or number)
i means the index of input_string
return_op is true means return operator, else return number
return_value is the operator's index in priority_matrix when return_op is true; return_value is the return number itself when return_op is false.
 */

void get_next_value(bool &return_op, int &return_value, int &i) {
    if (i == 0 && op_stack.empty()) { // begin of expression
        return_op = true;
        return_value = 0;
        return;
    }
    if (input_string[i] == '\0') { // end of expression
        return_op = true;
        return_value = 0;
        return;
    }
    if (input_string[i] >= '0' && input_string[i] <= '9') // number
        return_op = false;
    else {
        return_op = true; // real operator
        if (input_string[i] == '+')
            return_value = 1;
        else if (input_string[i] == '-')
            return_value = 2;
        else if (input_string[i] == '*')
            return_value = 3;
        else if (input_string[i] == '/')
            return_value = 4;
        i += 2; // leap the ' '
        return;
    }
    return_value = 0;
    //calculate number(maybe more than 1 digital)
    for (; input_string[i] != ' ' && input_string[i] != '\0'; i++) {
        return_value *= 10;
        return_value += input_string[i] - '0';
    }
    if (input_string[i] == ' ')
        i++;
    return;
}

int main(int argc, char const *argv[]) {
    // when arrive to the EOF, function gets return 0
    while (gets(input_string)) {
        if (input_string[0] == '0' && input_string[1] == '\0')
            break;
        bool return_op;
        int return_value;
        int index = 0;
        //clear two stacks
        while (!op_stack.empty())
            op_stack.pop();
        while (!num_stack.empty())
            num_stack.pop();

        while (true) {
            get_next_value(return_op, return_value, index);
            if (return_op == false) // next value is number
                num_stack.push(double(return_value));
            else { // next value is operator
                // the priority of current operator > the priority of op_stack's top operator or op_stack is empty
                if (op_stack.empty() || priority_matrix[return_value][op_stack.top()] == 1) {
                    op_stack.push(return_value);
                } else {
                    double temp_num_result;
                    while (priority_matrix[return_value][op_stack.top()] == 0) {
                        int top_op = op_stack.top();
                        op_stack.pop();
                        // the sequence of a and b is important(in '-' and '/' calculate)
                        double num_b = num_stack.top();
                        num_stack.pop();
                        double num_a = num_stack.top();
                        num_stack.pop();
                        if (top_op == 1)
                            temp_num_result = num_a + num_b;
                        else if (top_op == 2)
                            temp_num_result = num_a - num_b;
                        else if (top_op == 3)
                            temp_num_result = num_a * num_b;
                        else
                            temp_num_result = num_a / num_b;
                        num_stack.push(temp_num_result);
                    }
                    op_stack.push(return_value);
                }
            }
            // two mark-operator 0 in op_stack, means calculate finished
            if (op_stack.size() == 2 && op_stack.top() == 0)
                break;
        }
        // the last value in num_stack is the answer
        printf("%.2f\n", num_stack.top());
    }
    return 0;
}
